﻿using OnlineOrder.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineOrder.UI.管理员窗口
{
    public partial class ManagerForm : Form
    {
        public ManagerForm()
        {
            InitializeComponent();

            this.toolStripLabel2.Text = Middle.a;
        }

        

        private void Manager_Load(object sender, EventArgs e)
        {

        }


        private void toolStripButton1_Click(object sender, EventArgs e)
        {

            Dish dish = new Dish();

            //指示当前的父窗体为当前窗体
            dish.MdiParent = this;
            dish.Show();
            //判断当前我的子窗体个数如果大于1，只保存第一个
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            DingdanManage diandan = new DingdanManage();
            //指示当前的父窗体为当前窗体
            diandan.MdiParent = this;
            diandan.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }

        private void toolStripSplitButton1_Click(object sender, EventArgs e)
        {
            SocketService socketService = new SocketService();
            socketService.ShowDialog();
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            Business diandan = new Business();
            //指示当前的父窗体为当前窗体
            diandan.MdiParent = this;
            diandan.Show();
            if (this.MdiChildren.Length > 1)
            {
                var s = this.MdiChildren.FirstOrDefault();
                s.Close();
            }
        }
    }
}
